<template>
  <div class='public-switch'>
    <slot name="new_edition" v-if='currentEdition === "new"'></slot>
    <slot name="old_edition" v-else></slot>
  </div>
</template>
<script>
  export default {
    name: 'public-switch',
    componentName: 'public-switch',
    props: {
      edition: {
        type: String,
        default: 'old'
      }
    },
    data() {
      return {
        currentEdition: 'old'
      };
    },
    watch: {
      edition (newEdition) {
        this.currentEdition = newEdition
        this.$nextTick(() => {
          this.$emit('editionChange', newEdition)
        })
      }
    }
  };
</script>
<style lang="stylus" scoped>
   .public-switch
     width 100%
     height 100%
</style>
